package com.bj58.mis.apm.server.statistics.dto;

import java.util.regex.Pattern;

/**
 * @Author: wangxw
 * @Date: 2018/10/9 11:15
 */
public class DtoUtil {
    public static String getCubeCode(String cubeNameEn){
        if(cubeNameEn!=null){
            String reg = "^[0-9]*$";
            int idx = cubeNameEn.lastIndexOf("_");
            if(idx>0 && Pattern.matches(reg, cubeNameEn.substring(idx+1))){
                return cubeNameEn.substring(0, idx);
            }
        }
        return cubeNameEn;
    }
}
